package com.smartStatus.admin.controller;

import com.smartStatus.admin.service.SysFileService;

import com.smartStatus.api.vo.SysUserVO;
import com.smartStatus.core.util.R;
import com.smartStatus.security.annoation.Ignore;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import org.springframework.mock.web.MockMultipartFile;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;

/**
 * @ClassName : SysFileController
 * @Author : lby
 * @Date: 2021/3/2 17:04
 * @Description : 文件管理
 */
@RestController
@Slf4j
@Api(value = "SysFile", tags = "文件管理")
@AllArgsConstructor
@RequestMapping("sysFile")
public class SysFileController {

    private final SysFileService sysFileService;


    @Ignore(value = false)
    @GetMapping("/{bucketName}/{fileName}")
    public void getFile(@PathVariable("bucketName") String bucketName, @PathVariable("fileName") String fileName, HttpServletResponse response) {
        sysFileService.getFile(bucketName, fileName, response);
    }
}
